package com.hankol.winecellar.viewmodel

import com.baselibrary.bean.*
import com.baselibrary.net.result.HttpResult
import com.hankol.winecellar.bean.BannerConfigListBean
import com.hankol.winecellar.bean.SeckillAddSubscribeBean
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface BaseApi {
    /**
     * 添加关注
     *
     */
    @FormUrlEncoded
    @POST("focusFans/add")
    fun reqAddFollow(@Field("token") token: String, @Field("type") type: Int, @Field("thirdId") thirdId: Long): Observable<HttpResult<Boolean>>

    /**
     * 取消关注
     *
     * @return
     */
    @FormUrlEncoded
    @POST("focusFans/del")
    fun reqCancelFollow(@Field("token") token: String, @Field("type") type: Int, @Field("thirdId") typeId: Long): Observable<HttpResult<Boolean>>

    /**
     * 添加收藏
     * @return
     */
    @FormUrlEncoded
    @POST("web/favorite/add")
    fun reqAddCollection(@Field("token") token: String, @Field("type") type: Int, @Field("typeId") typeId: Long): Observable<HttpResult<Boolean>>

    /**
     * 取消收藏
     * type"类型：1文章 2产品 3课程 4动态 5讲坛 6专栏 7约局
     * @return
     */
    @FormUrlEncoded
    @POST("web/favorite/delete")
    fun reqCancelCollection(@Field("token") token: String, @Field("type") type: Int, @Field("typeId") typeId: Long): Observable<HttpResult<Boolean>>

    /**
     * 点赞
     *
     * @return
     */
    @FormUrlEncoded
    @POST("web/support/add")
    fun reqAddSupport(@Field("token") token: String, @Field("type") type: Int, @Field("typeId") typeId: Int): Observable<HttpResult<Boolean>>

    /**
     * 取消点赞
     *
     * @return
     */
    @FormUrlEncoded
    @POST("web/support/delete")
    fun reqCancelSupport(@Field("token") token: String, @Field("type") type: Int, @Field("typeId") typeId: Int): Observable<HttpResult<Boolean>>

    /**
     * 删除动态
     *
     * @return
     */
    @FormUrlEncoded
    @POST("timeline/delete")
    fun deleteTimeline(@Field("token") token: String, @Field("tid") tid: String, @Field("status") status: String): Observable<HttpResult<String>>







    /**
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("timeline/addForwardNum")
    fun reqAddShareNum(@Field("token") token: String, @Field("id") id: Long): Observable<HttpResult<Any>>

    /**秒杀--添加预约
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("seckill/subscribe/add")
    fun reqSeckillAddSubscribe(@Field("actId") actId: String): Observable<HttpResult<SeckillAddSubscribeBean>>

    /**秒杀--取消预约
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("seckill/subscribe/cancel")
    fun reqSeckillCancelSubscribe(@Field("actId") actId: String): Observable<HttpResult<Any>>

    /**根据类型获取banner列表（首页大改版）
     * @param bannerType： banner类型 0首页banner 1商城banner 2附近banner 3中心banner 4话题轮播图
     * @return
     */
    @FormUrlEncoded
    @POST("homePage/v1.0/getBannerConfigList")
    fun reqGetBannerConfigList(@Field("bannerType") bannerType: Int,@Field("otherId") otherId: Long=-1): Observable<HttpResult<BannerConfigListBean>>


}